package com.cavy.platform.server.dto;

import com.cavy.platform.server.validator.FormatValidatorGroup;
import com.cavy.platform.server.validator.GitUrl;
import com.cavy.platform.server.validator.LastValidatorGroup;
import com.cavy.platform.server.validator.NotRepeatPluginRepositoryName;
import lombok.Data;

import javax.validation.GroupSequence;
import javax.validation.constraints.NotNull;

/**
 * Created by tangxu on 18-7-11.
 */
@Data
@NotRepeatPluginRepositoryName(groups = LastValidatorGroup.class)
@GroupSequence({FormatValidatorGroup.class, LastValidatorGroup.class, PluginRepositorySettingCreateDto.class})
public class PluginRepositorySettingCreateDto {
    @NotNull(message = "名称不能为空", groups = FormatValidatorGroup.class)
    private String name;
    @NotNull(message = "code不能为空", groups = FormatValidatorGroup.class)
    private String code;
    @NotNull(message = "仓库地址不能为空", groups = FormatValidatorGroup.class)
    @GitUrl(message = "仓库地址错误", groups = FormatValidatorGroup.class)
    private String url;
    @NotNull(message = "分支不能为空", groups = FormatValidatorGroup.class)
    private String branchName = "master";
}
